<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% error_category ||= '404' %>
<form id="submit_error_form" style="<%= hidden %>" action="<%= errors_path %>" method="POST">
  <%= hidden_field :error, :category, :value => error_category %>
  <%= hidden_field :error, :id, :value => (@error.try(:id)) %>
  <%= hidden_field :error, :url, :value => (request.url rescue "") %>
  <div style="width: 100%; margin: 0px auto;">
    <%= text_field :error, :username, :value => "" %><%# this is a honeypot field. it's hidden via css, but spambots don't know that. %>
    <%= text_area :error, :comments, :style => "width: 100%; height: 100px; border: 1px solid #888;" %>
    <% if @current_user %>
      <%= before_label('email_optional', %{Email (optional)}) %>
    <% else %>
      <%= before_label('email_required', %{Email (required)}) %>
    <% end %>
    <%= text_field :error, :email, :value => (@current_user.email rescue ""), :style => "border: 1px solid #888;" %>
  </div>
  <div class="button-container">
    <button type="submit" class="btn">{{#t}}Send Comments{{/t}}</button>
  </div>
</form>

<% js_bundle 'legacy/error_form' %>
